//
//  TTBasicTableViewController.swift
//  WeiBo
//
//  Created by 涂永江 on 2017/6/5.
//  Copyright © 2017年 涂永江. All rights reserved.
//

import UIKit

class TTBasicTableViewController: UITableViewController {

    var isfalse = TTHMUserAccountViewModel.sharedAccountModel.isaccess
    
    
    var basicView :TTBasicView?
    
    override func viewDidLoad() {
        super.viewDidLoad()
    
        
     
    }
    
    func setUI()
    {
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title1: "注册", target: self, action: #selector(zhuce))
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title1: "登录", target: self, action: #selector(denglv))
    }
    
    func zhuce()
    {
         presntVc()
    }
    func denglv()
    {
       presntVc()
    }
    
    override func loadView() {
        
        //设置自定义视图
        if isfalse {
         super.loadView()
//        super.loadView()
           
        }else
        {
            setUI()
            basicView = TTBasicView()
            basicView?.closore = {
            
            print("回调")
            self.presntVc()
            }

            view = basicView
        
        }
        
    }
    
    func presntVc()
    {
    let presentVc = TTPresentViewController()
     let nav = TTNavViewController(rootViewController: presentVc)
      self.present(nav, animated: true, completion: nil)
     
    }
    

}
